﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data" 
    xmlns:dataPrimitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls.Data">
    <!-- Resource dictionary entries should be defined here. -->
    <Style x:Key="NotSelectedDataGridRowStyle" TargetType="data:DataGridRow">
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="data:DataGridRow">
                    <dataPrimitives:DataGridFrozenGrid x:Name="Root">
                        <dataPrimitives:DataGridFrozenGrid.Resources>
                            <Storyboard x:Key="DetailsVisibleTransition">
                                <DoubleAnimation Duration="00:00:0.1" Storyboard.TargetName="DetailsPresenter" Storyboard.TargetProperty="ContentHeight"/>
                            </Storyboard>
                        </dataPrimitives:DataGridFrozenGrid.Resources>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="NormalAlternatingRow">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </VisualState>
                                <!--<VisualState x:Name="MouseOver">
									<Storyboard>
										<DoubleAnimation Duration="0" Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" To=".5"/>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="NormalSelected">
									<Storyboard>
										<DoubleAnimation Duration="0" Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" To="1"/>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="MouseOverSelected">
									<Storyboard>
										<DoubleAnimation Duration="0" Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" To="1"/>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="UnfocusedSelected">
									<Storyboard>
										<DoubleAnimation Duration="0" Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Opacity" To="1"/>
										<ColorAnimation Duration="0" Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Fill).Color" To="#FFE1E7EC"/>
									</Storyboard>
								</VisualState>-->
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="Valid"/>
                                <VisualState x:Name="Invalid">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="InvalidVisualElement" Storyboard.TargetProperty="Opacity" To="1"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <dataPrimitives:DataGridFrozenGrid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                        </dataPrimitives:DataGridFrozenGrid.RowDefinitions>
                        <dataPrimitives:DataGridFrozenGrid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition/>
                        </dataPrimitives:DataGridFrozenGrid.ColumnDefinitions>
                        <Rectangle x:Name="BackgroundRectangle" Fill="#FFBADDE9" Opacity="0" Grid.ColumnSpan="2" Grid.RowSpan="2"/>
                        <Rectangle x:Name="InvalidVisualElement" Fill="#FFF7D8DB" Opacity="0" Grid.ColumnSpan="2" Grid.RowSpan="2"/>
                        <dataPrimitives:DataGridRowHeader x:Name="RowHeader" Grid.RowSpan="3" dataPrimitives:DataGridFrozenGrid.IsFrozen="True" Background="#99E9EEF4"/>
                        <dataPrimitives:DataGridCellsPresenter x:Name="CellsPresenter" Grid.Column="1" dataPrimitives:DataGridFrozenGrid.IsFrozen="True"/>
                        <dataPrimitives:DataGridDetailsPresenter x:Name="DetailsPresenter" Grid.Column="1" Grid.Row="1"/>
                        <Rectangle x:Name="BottomGridLine" Height="1" Fill="Gray" Visibility="Visible" Opacity="1" HorizontalAlignment="Stretch" Grid.Column="1" Grid.Row="2"/>
                        <Border BorderBrush="#AA888888" BorderThickness="0, 1, 0, 0" Grid.Column="1" Grid.Row="2"/>
                    </dataPrimitives:DataGridFrozenGrid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="NotSelectedDataGridCellStyle" TargetType="data:DataGridCell">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="data:DataGridCell">
                    <Grid x:Name="Root" Background="{TemplateBinding Background}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CurrentStates">
                                <VisualState x:Name="Regular"/>
                                <!--<VisualState x:Name="Current">
									<Storyboard>
										<DoubleAnimation Duration="0" Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity" To="1"/>
									</Storyboard>
								</VisualState>-->
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="Valid"/>
                                <VisualState x:Name="Invalid">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="InvalidVisualElement" Storyboard.TargetProperty="Opacity" To="1"/>
                                        <ColorAnimation Duration="0" Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="(Fill).Color" To="#FFFFFFFF"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle x:Name="FocusVisual" Fill="#66FFFFFF" Stroke="#FF6DBDD1" StrokeThickness="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsHitTestVisible="false" Opacity="0"/>
                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                        <Rectangle x:Name="InvalidVisualElement" Stroke="#FFDC000C" StrokeThickness="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsHitTestVisible="False" Opacity="0"/>
                        <Rectangle x:Name="RightGridLine" VerticalAlignment="Stretch" Width="1" Grid.Column="1"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>